package org.ResearchProject.mapper;

import org.ResearchProject.dto.ThisProjectPeopleDto;
import org.ResearchProject.pojo.ResearchProject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;
import java.util.List;

/**
 * 2024-12-13-19:27
 */
@Mapper
public interface ResearchProjectMapper {
    @Insert("insert into research_project(name,description,procession,start_time,end_time,create_person) " +
            "values(#{name},#{description},#{procession},#{startTime},#{endTime},#{createPerson})")
    void insertResearchProject(ResearchProject researchProject);

    void addMembers(ArrayList<Integer> members, int projectId, int tutorId);

    ThisProjectPeopleDto getThisProjectPeople(int projectId);

    void deleteMembers(ArrayList<Integer> members, Integer projectId, Integer tutorId);
    @Delete("delete from research_project where id=#{projectId}")
    void deleteProject(Integer projectId);

    void updateProject(ResearchProject researchProject);
}
